home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_objc.idb / usr / freeware / include / cakit / intmodp.h.z / intmodp.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  929 b   |  57 lines

  1.  
  2. /*
  3.  * Computer Algebra Kit (c) 1993,98 by Comp.Alg.Objects.  All Rights Reserved.
  4.  * $Id: intmodp.h,v 1.1.1.1 1999/03/22 21:48:43 stes Exp $
  5.  */
  6.  
  7. #ifndef __CAINTEGERMODP_HEADER__
  8. #define __CAINTEGERMODP_HEADER__
  9.  
  10. #include "cobject.h"
  11.  
  12. #define USHRT_MAX_PRIME 65521U
  13. typedef unsigned short modp_t;
  14.  
  15. @interface IntegerModp : CAObject
  16. {
  17.   modp_t value;
  18.   unsigned short modulus;
  19. }
  20.  
  21. + modulus:(unsigned short)aPrime;
  22. + int:(int)intValue modulus:(unsigned short)aPrime;
  23.  
  24. - (unsigned) hash;
  25. - (BOOL) isEqual:b;
  26. - (unsigned short) modulus;
  27. - (int) intValue;
  28. - intValue:(int)aValue;
  29.  
  30. - zero;
  31. - (BOOL) isZero;
  32. - (BOOL) isOpposite:b;
  33. - negate;
  34. - double;
  35. - add:b;
  36. - subtract:b;
  37.  
  38. - one;
  39. - minusOne;
  40. - (BOOL) isOne;
  41. - (BOOL) isMinusOne;
  42. - square;
  43. - multiply:b;
  44. - inverse;
  45. - divide:b;
  46.  
  47. - (int) characteristic;
  48. - frobenius;
  49. - frobeniusInverse;
  50.  
  51. - (BOOL) printsLeadingSign;
  52. - printOn:(IOD)aFile;
  53. @end
  54.  
  55. #endif                /* __CAINTEGERMODP_HEADER__ */
  56.  
  57.